import { defAxios as request } from '@/utils/http'
export function useExpertsApi() {
    return {
        reviewtaskDeleteData,
        reviewtaskGetData,
        reviewtaskSaveData,
        saveExpertByProject,
        reviewtaskCancelProjects,
        reviewtaskStartTaskData,
        reviewtaskStopTaskData,
        saveAssignExperts,
        saveExpertByRule,
        getTaskInfoByApplyId,
        expertManageSave,
        expertManageDetailInfo,
        expertManageAssignRuleList,
        expertManageNotAssignRuleList,
        expertManageSaveRule,
        expertManageDelete
    }
}

//删除评审任务
 function reviewtaskDeleteData(params) {
    return request({
        url: '/reviewtask/delete',
        method: 'post',
        data: params
    })
}

//获取单个评审任务数据
 function reviewtaskGetData(taskId) {
    return request({
        url: `/reviewtask/get/${taskId}`,
        method: 'get',
    })
}

//保存评审任务
function reviewtaskSaveData(params) {
    return request({
        url: '/reviewtask/save',
        method: 'post',
        data: params
    })
}

//按项目分配专家-保存专家
 function saveExpertByProject(params) {
    return request({
        url: '/reviewtask/saveExpertByProject',
        method: 'post',
        data: params
    })
}

//撤销评审任务
 function reviewtaskCancelProjects(params) {
    return request({
        url: '/reviewtask/cancelProjects',
        method: 'post',
        data: params
    })
}


//启用评审任务
 function reviewtaskStartTaskData(params) {
    return request({
        url: '/reviewtask/startTask',
        method: 'post',
        data: params
    })
}

//停用评审任务
 function reviewtaskStopTaskData(params) {
    return request({
        url: '/reviewtask/stopTask',
        method: 'post',
        data: params
    })
}

//按规则分配专家-组装专家项目数据
 function saveAssignExperts(params) {
    return request({
        url: '/reviewtask/makeProjectExpertDate',
        method: 'post',
        data: params
    })
}

//按规则分配专家-保存专家
  function saveExpertByRule(params) {
    return request({
        url: '/reviewtask/saveExpertByRule',
        method: 'post',
        data: params
    })
}

 function getTaskInfoByApplyId(params) {
    return request({
        url: `/reviewApply/getTaskInfoByApplyId/${params}`,
        method: 'get',
    })
}

//专家管理-保存专家
  function expertManageSave(params) {
    return request({
        url: '/expert/save',
        method: 'post',
        data: params
    })
}

//专家管理-专家详情
 function expertManageDetailInfo(params) {
    return request({
        url: `/expert/get`,
        method: 'post',
        data: params
    })
}
 function expertManageAssignRuleList(expertId) {
    return request({
        url: `/expert/assignRuleList/${expertId}`,
        method: 'get',
    })
}
function expertManageNotAssignRuleList(params) {
    return request({
        url: `/expert/notAssignRuleList`,
        method: 'post',
        data: params
    })
}
function expertManageSaveRule(params) {
    return request({
        url: `/expert/saveRule`,
        method: 'post',
        data: params
    })
}
function expertManageDelete(params) {
    return request({
        url: `/expert/delete`,
        method: 'post',
        data: params
    })
}
